﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GuanYijia.DoMain
{
    /// <summary>
    /// 单据主表
    /// </summary>
    public class Documents
    {
        [Key]
        public int documentsid { get; set; }
        //类型(出库/入库)
        [StringLength(100)]
        public string? type { get; set; }
        //出入库分类
        [StringLength(100)]
        public string? sub_type { get; set; }
        //初始票据号
        [StringLength(100)]
        public string? default_number { get; set; }
        //票据号
        [StringLength(100)]
        public string ? number { get; set; }
        //创建时间
        public DateTime? create_time { get; set; }
        //出入库时间
        public DateTime? oper_time { get; set; }

        //供应商Id(单位Id/收款/付款单位)
        public int? SupplierId { get; set; }

        //经手人id
        public int? hands_person_id { get; set; }
        //操作员
        public int? CreatorId { get; set; }
        //账户Id
        public int? AccountId { get; set; }

        //变动金额(优惠/收款/付款/实付)
        [Column(TypeName = "decimal(9,2)")]
        public decimal? change_amount { get; set; }

        //合计金额
        [Column(TypeName = "decimal(9,2)")]

        public decimal? total_price { get; set; }

        //付款类型(现金、记账等)
        [StringLength(100)]
        public string?  pay_type { get; set; }
        //单据类型
        [StringLength(100)]
        public string? bill_type { get; set; }
        //备注
        [StringLength(100)]
        public string? remark { get; set; }
        //附件名称
        [StringLength(100)]

        public string? file_name { get; set; }

        //业务员（可以多个）
        [StringLength(100)]
        public string? sales_man { get; set; }
        //多账户ID列表
        [StringLength(100)]
        public string? account_id_list { get; set; }
        //多账户金额列表 
        [StringLength(100)]
        public string? account_money_list { get; set; }
        //优惠率
        [Column(TypeName = "decimal(9,2)")]
        public decimal?  discount { get; set; }

        //优惠金额

        [Column(TypeName = "decimal(9,2)")]

        public decimal? discount_money { get; set; }
        //优惠后金额
        [Column(TypeName = "decimal(9,2)")]
        public decimal? discount_last_money { get; set; }
        //销售或采购费用合计
        [Column(TypeName = "decimal(9,2)")]
        public decimal?  other_money { get; set; }
        //销售或采购费用涉及项目Id数组（包括快递、招待等）
        [StringLength(100)]
        public string? other_money_list { get; set; }

        //销售或采购费用涉及项目（包括快递、招待等）
        [StringLength(100)]
        public string? other_money_item { get; set; }

        //结算天数
        public int? account_day { get; set; }
        //单据状态(未审核、已审核)
        public bool? status { get; set; }
        //关联订单号
        [StringLength(100)]
        public string?  link_number { get; set; }
        //租户id
        public int? tenant_id { get; set; }
        //删除标记，0未删除，1删除，默认0
        public bool? delete_flag { get; set; }= false;


    }
}
